<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>原型</title>
    <script type="text/javascript">
        /**
         * 原型prototype
         */
        function MyClass() {}

        // 向MyClass的原型中添加属性a
        MyClass.prototype.a = 123;

        var mc = new MyClass();
        var mc2 = new MyClass();

        console.log(MyClass.prototype == mc.__proto__);  // true 
        console.log(mc.a) // 123


        mc.a = "我是mc中的a"
        console.log(mc.a) // 我是mc中的a

    </script>


</head>
<body>
    
</body>
</html>